<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/vuejs-2.5.16.js"></script>

</head>
<body>

        <div id="app">

                <input type="text" v-model="num1"/>+<input type="text" v-model="num2"/>= {{num3}}<input type="button" value="计算" @click="fun"/>
            <br/>
            <input type="text" v-model="user.name" /><br/> <input type="text" v-model="user.sex" /><br/> <input type="text" v-model="user.address" /><br/>

        </div>
</body>

<script>
        new Vue({
            el:"#app",
            data:{
                num1:0,
                num2:0,
                num3:0,
                user:{
                    name:"张三",
                    sex:"男",
                    address:"宜昌"
                }
            },
            methods:{
                fun:function(){
                   this.num3 =parseInt(this.num1)+parseInt(this.num2);
                }
            }
        })
</script>

</html>